package com.cadre.system.service.impl;

import com.cadre.system.domain.officer.Chart;
import com.cadre.system.domain.officer.SysConfigEntity;
import com.cadre.system.mapper.DPersontagMapper;
import com.cadre.system.mapper.D_PERSONTAGMapper;
import com.cadre.system.mapper.InverseQueryMapper;
import com.cadre.system.service.ChartMsgService;
import com.cadre.system.service.SysConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.*;

@Service("chartMsgService")
public class ChartMsgServiceImpl implements ChartMsgService {
    @Autowired
    private DPersontagMapper dPersontagMapper;
    @Autowired
    private D_PERSONTAGMapper d_PERSONTAGMapper;
    @Autowired
    private InverseQueryMapper inverseQueryMapper;
    @Autowired
    private SysConfigService sysConfigService;

    @Override
    public List<Chart> chartAll(Map<String, Object> map) {
        return this.dPersontagMapper.getAllCount(map);
    }

    @Override // com.tdqy.cadre.modular.profess.service.ChartMsgService
    public List<Chart> selectByTagid() {
        return this.d_PERSONTAGMapper.selectByTagid();
    }

    @Override // com.tdqy.cadre.modular.profess.service.ChartMsgService
    public List<Chart> totalAgeByTagid(String roleId, String unitCode) {
        return this.d_PERSONTAGMapper.selectByTagidSummary(roleId, unitCode);
    }

    @Override // com.tdqy.cadre.modular.profess.service.ChartMsgService
    public List<Chart> totalUserAgeByTagid(String userId, String unitCode) {
        return this.d_PERSONTAGMapper.selectByUserTagidSummary(userId, unitCode);
    }

    @Override // com.tdqy.cadre.modular.profess.service.ChartMsgService
    public List<Chart> totalAllByTagid(String tagId, String roleId, String unitCode) {
        return this.d_PERSONTAGMapper.totalByTagidSummary(tagId, roleId, unitCode);
    }

    @Override // com.tdqy.cadre.modular.profess.service.ChartMsgService
    public List<Chart> totalAllUserByTagid(String tagId, String userId, String unitCode) {
        return this.d_PERSONTAGMapper.totalByUserTagidSummary(tagId, userId, unitCode);
    }

    @Override // com.tdqy.cadre.modular.profess.service.ChartMsgService
    public List<Chart> totalAgeByA01Static(String userId, String unitCode) {
        List<String> uList = new ArrayList();
        if (unitCode != null) {
            uList = Arrays.asList(unitCode.split(","));
        }
        Map<String, Object> fmap = new HashMap<>();
        return this.inverseQueryMapper.queryAgeSummaryByUnits(userId, uList, fmap);
    }

    @Override // com.tdqy.cadre.modular.profess.service.ChartMsgService
    public List<Chart> queryJoinPartSummary(String userId, String unitCode) {
        List<String> uList = new ArrayList();
        if (unitCode != null) {
            uList = Arrays.asList(unitCode.split(","));
        }
        Map<String, Object> fmap = new HashMap<>();
        return this.inverseQueryMapper.queryJoinPartSummaryByUnits(userId, uList, fmap);
    }

    @Override // com.tdqy.cadre.modular.profess.service.ChartMsgService
    public List<Chart> queryEducationSummary(String userId, String unitCode, String status) {
        List<String> uList = new ArrayList();
        if (unitCode != null) {
            uList = Arrays.asList(unitCode.split(","));
        }
        Map<String, Object> fmap = new HashMap<>();
        return this.inverseQueryMapper.queryEducationSummaryByUnits(userId, uList, status, fmap);
    }

    @Override // com.tdqy.cadre.modular.profess.service.ChartMsgService
    public List<Chart> queryCadreSummary(String userId, String unitCode) {
        List<String> uList = new ArrayList<>();
        if (unitCode != null)
            uList = Arrays.asList(unitCode.split(","));
        Map<String, Object> fmap = new HashMap<>();
        return this.inverseQueryMapper.queryCadreSummaryByUnits(userId, uList, fmap);
    }

    @Override // com.tdqy.cadre.modular.profess.service.ChartMsgService
    public List<Chart> queryNationSummary(String userId, String unitCode) {
        List<String> uList = new ArrayList();
        if (unitCode != null) {
            uList = Arrays.asList(unitCode.split(","));
        }
        Map<String, Object> fmap = new HashMap<>();
        return this.inverseQueryMapper.queryNationSummaryByUnits(userId, uList, fmap);
    }

    @Override // com.tdqy.cadre.modular.profess.service.ChartMsgService
    public List<Chart> querySexSummary(String userId, String unitCode) {
        List<String> uList = new ArrayList();
        if (unitCode != null) {
            uList = Arrays.asList(unitCode.split(","));
        }
        Map<String, Object> fmap = new HashMap<>();
        return this.inverseQueryMapper.querySexSummaryByUnits(userId, uList, fmap);
    }

    @Override // com.tdqy.cadre.modular.profess.service.ChartMsgService
    public Chart queryQiye(String userId, String unitCode) {
        return this.inverseQueryMapper.queryQiye(userId, unitCode);
    }
}
